home *** CD-ROM | disk | FTP | other *** search
/ Garbo / Garbo.cdr / mac / hypercrd / hc2_x / tcprogud.sit / TC Prog Guide / card_16926.txt < prev    next >
Text File  |  1991-02-27  |  1KB  |  34 lines

  1. -- card: 16926 from stack: in
  2. -- bmap block id: 0
  3. -- flags: 0000
  4. -- background id: 4755
  5. -- name: 
  6.  
  7.  
  8. -- part contents for background part 4
  9. ----- text -----
  10.     printf("Enter age and weight separated by spaces:\n");
  11.  
  12. 'printf()' is a function defined in the ANSI library, for formatted output to the STANDARD OUTPUT device - usually the screen.  (On UNIX systems, printf() output can be redirected to a file, and this is simulated in TC using the ccommand() library function.)
  13.  
  14. printf() accepts a character string (actually an array of char variables) as its first argument, optionally followed by additional arguments.  The escape sequence '\n' in the character string tells C to begin a new line following this output.
  15.  
  16. Notice that all function calls in C are expressions which represent a value (or void).  In fact, printf() returns the number of characters successfully printed, but we are ignoring this value here.
  17.  
  18. If a function is used in a C source file, the compiler requires either a declaration or a definition of the function in the source file as well.  The declaration for printf() is contained in the file stdio.h, which was #included into this file via the preprocessor*.
  19.  
  20. -- part contents for background part 27
  21. ----- text -----
  22. Header files
  23.  
  24. -- part contents for background part 29
  25. ----- text -----
  26. 11521
  27.  
  28. -- part contents for background part 20
  29. ----- text -----
  30. Header files - p20
  31.  
  32. -- part contents for background part 7
  33. ----- text -----
  34. 28